package WrittenTest;

import java.util.*;

public class test28 {
    // 比那名居的桃子
    // 算法原理：滑动窗口
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 处理输入
        int n = in.nextInt(), k = in.nextInt();
        long[] num1 = new long[n], num2 = new long[n];
        for (int i = 0; i < n; i++) {
            num1[i] = in.nextLong();
        }
        for (int i = 0; i < n; i++) {
            num2[i] = in.nextLong();
        }
        long sum1 = 0, sum2 = 0, hMax = 0, sMin = 0, day = 0;
        // 进窗口
        for (int left = 0, right = 0; right < n; right++) {
            sum1 += num1[right];
            sum2 += num2[right];
            // 判断窗口是否合理
            while (right - left + 1 > k) {
                // 出窗口
                sum1 -= num1[left];
                sum2 -= num2[left];
                left++;
            }
            // 判断并更新结果
            if (right - left + 1 == k) {
                if (sum1 > hMax) {
                    hMax = sum1;
                    sMin = sum2;
                    day = left;
                } else if (sum1 == hMax && sum2 < sMin) {
                    sMin = sum2;
                    day = left;
                }
            }
        }
        // 由于下标从零开始，所以结果天数 +1
        System.out.println(day + 1);
    }
}
